home *** CD-ROM | disk | FTP | other *** search
- <?xml version="1.0" encoding="utf-8" ?>
- <!DOCTYPE stack PUBLIC "-//Apple, Inc.//DTD stack V 2.0//EN" "" >
- <stack>
- <name>in</name>
- <id>-1</id>
- <cardCount>2</cardCount>
- <cardID>2916</cardID>
- <listID>2407</listID>
- <cantModify><false /></cantModify>
- <cantDelete><false /></cantDelete>
- <cantAbort><false /></cantAbort>
- <cardSize>
- <width>512</width>
- <height>342</height>
- </cardSize>
- <script>-- All of the routines in this stack are used to create and run a help system. This system is very
- -- simple to implement and reasonably quick depending on what options you allow.
- -- These scripts should be added to either the stack script or the home card. This way they
- -- will allways be available within any card.
- --
- -- NOTE: if you use any of these handlers anywhere else in your system then you should be sure
- -- that you use the "PASS" command to pass the handler on. Otherwise it will never reach
- -- here.
- --
- -- To use the system you must put the help information at the beginning of the script for a container
- -- whether it is a button or a field. Each "Paragraph" should start with "--" to indicate a comment
- -- line. The very last line of the help information should be "--EndOfHelp"
- -- To activate the help system hold the "OPTION" key down while moving the mouse into a container.
- -- The system will display all of the lines up to but not including the "--EndOfHelp" line in a card
- -- field called "Help". This implies that the card field must exist on each card that is processed.
- -- In order to work properly it must be the last card item created. Otherwise it will not appear
- -- on top of items where it is appropriate.
- -- The opencard handler does this. If you do not wish this to happen automatically then either
- -- delete or comment out the appropriate lines. You will then need to set up the Help field on the
- -- cards that you want it on. The field should be a scrolling field and have the locked text
- -- property set to true. This allows a mouseup within the field to be recognized.
- --
- -- HANDLER DESCRIPTIONS
- -- OpenCard
- -- The first thing OpenCard does is check to see if there is a Help card field. If there isn't
- -- then it creates one. This section should either be deleted or commented out if you do not
- -- want this feature. Eliminating it will speed up going from card to card.
- -- Next it sets the 5 global variables that are needed for the system to work properly
- -- CardH, CardV, HelpH, HelpV are the size of the card and help field. They are used to be sure
- -- that the field will display completely within the window of the card.
- -- If automatic creation of a helpfield is left in then the line "If there is a card field "Help"'
- -- can be eliminated along with its corresponding 'end if' statement.
- --
- -- CloseCard
- -- This has 2 functions that should not be done together since it would waste time.
- -- First, if the help field is there an it is visible then it will empty it and hide it. This is basically
- -- a reset.
- -- Second, the help field is deleted from the stack. If you decide to do this then you should
- -- comment out the first part.
- --
- -- MouseEnter
- -- This is the heart of the system.
- -- First, it checks to be sure the option key is down and there is a card field called "Help".
- -- If the field you ask for help on is the help field then nothing happens. This could be changed
- -- if you wished to provide help information about itsself.
- -- Second, it checks to be sure there is help information available first by checking for a script
- -- and then by making sure there was an end of help marker (see above). The information is then
- -- put into the help field.
- -- Third, it positions the help field so that it will normally be aligned with the top of the target
- -- and will appear to the right of the target. Checks are made to be sure that the entire help field
- -- will fit on the window. Its position is adjusted accordingly. First to the left of the target, then
- -- above the target and then just shoved over to fit.
- -- Last, the field is displayed and the HelpWaitTime is set to allow 5 seconds per line for the user
- -- to read the information.
- --
- -- MouseUp
- -- This is used to dismiss the help field if the user clicks in it.
- --
- -- MouseWithin
- -- This is used to prevent idle from dismissing the help field. As long as the user places the
- -- pointer within the help field then the field will never be dismissed.
- --
- -- idle
- -- If the help field is visible then it starts to time how long it has been visible. 5 seconds per line
- -- is allowed and then it will empty and hide the help field. If the mouse is kept within the
- -- help field then this will not happen.
-
- on OpenCard
- global CardH,CardV,HelpH,HelpV,HelpWaitTime
- put the bottom of this card - the top of this card into CardV
- put the right of this card - the left of this card into CardH
- -- This if-end if section should be commented out if you do not wish to have automatic
- -- creation of the card field "Help"
- if there is not a card field "Help" then
- lock screen
- domenu "New Field"
- choose browse tool
- set the name of the last card field to "Help"
- set the style of card field "Help" to "Scrolling"
- set the textfont of card field "Help" to Geneva
- set the textsize of card field "Help" to 10
- set the rect of card field "Help" to 0,0,250,100
- set the locktext of card field "Help" to true
- Hide card field "Help"
- end if
- if there is a card field "Help" then
- put the bottom of card field "Help" - the top of card field "Help" into HelpV
- put the right of card field "Help" - the left of card field "Help" into HelpH
- end if
- pass opencard
- end OpenCard
-
- on CloseCard
- global HelpWaitTime
- if there is a card field "Help" then
- put 0 into HelpWaitTime
- if visible of card field "Help" then
- hide card field "Help"
- put empty into card field "Help"
- end if
- --This next section is used to delete the card field "Help" when the card is closed
- --It is not required. If you decide to use it then the part of the opencard handler
- --that creates the field should be uncommented.
- put the lockscreen into LS
- lock screen
- show card field "Help"
- choose field tool
- click at loc of card field "Help"
- domenu "clear field"
- choose browse tool
- set the lockscreen to LS
- end if
- pass closecard
- end CloseCard
-
- on MouseEnter
- Global CardH,CardV,HelpH,HelpV,HelpWaitTime
- if the optionkey is "Down" and there is a card field "Help" then
- if the name of the target is not "card field"&"e&"Help""e then
- put the script of the target into junk
- if junk is not empty then
- put offset ("--EndOfHelp",junk) into s
- if s > 0 then
- lock screen
- put (the name of the target)&return&(char 1 to s-1 of junk) into card field "Help"
- set the textstyle of line 1 of card field "Help" to bold
- put the top of the target into t
- put the right of the target into r
- if r + helpH > cardH then set the right of card field "Help" to the left of the target
- else set the left of card field "Help" to r
- if t + HelpV > CardV then set the bottom of card field "Help" to the bottom of the target
- else set the top of card field "Help" to t
- if the top of card field "Help"<0 then set the top of card field "Help" to 0
- if the left of card field "Help"<0 then set the left of card field "Help" to 0
- if the right of card field "Help">CardH then set the right of card field "Help" to cardH
- if the bottom of card field "Help" > CardV then set the bottom of card field "Help" to cardV
- show card field "Help"
- put the seconds + (5 * the number of lines in card field "Help") into HelpWaitTime
- end if
- end if
- end if
- end if
- pass mouseenter
- end MouseEnter
-
- On MouseUp
- if the name of the target is "card field"&"e&"Help""e then hide card field "Help"
- pass MouseUp
- end MouseUp
-
- On MouseWithin
- Global HelpWaitTime
- if there is a card field "Help" then
- if (visible of card field "Help") and (the mouseloc is within the rect of card field "Help") then put 0 into HelpWaitTime
- end if
- pass mousewithin
- end MouseWithin
-
- on idle
- global HelpWaitTime
- if there is a card field "Help" then
- if the visible of card field "Help" then
- if HelpWaitTime is 0 then
- put the seconds + (5 * the number of lines in card field "Help") into HelpWaitTime
- else
- if the seconds >= HelpWaitTime then
- put empty into card field "Help"
- hide card field "Help"
- end if
- end if
- end if
- end if
- pass idle
- end idle
-
- </script>
- <background id="2812" file="background_2812.xml" name="" />
- <card id="2916" file="card_2916.xml" marked="false" name="" owner="2812" />
- <card id="2283" file="card_2283.xml" marked="false" name="" owner="2812" />
- </stack>
-